export default{
	namespaced:true,
	
	state:()=>({
		token:'',
		userinfo:JSON.parse(uni.getStorageSync('userinfo')||'{}'),
		redirectInfo:null
	}),
	
	
	mutations:{
		updateUserInfo(state,userInfo){
			state.userinfo=userInfo
			this.commit('m-user/saveUserInfoToStorage')
		},
		saveUserInfoToStorage(state){
			uni.setStorageSync('userinfo',JSON.stringify(state.userinfo))
		},
		updateToken(state,token){
			state.token=token
			this.commit('m-user/saveToken')
		},
		saveToken(state){
			uni.setStorageSync('token',state.token)
		},
		updateRediectInfo(state,info){
			state.redirectInfo=info
		}
	},
	getters:{}
}